Optimal. Leaf size=65 \[ \frac {b x}{d}-\frac {2 (b c-a d) \tan ^{-1}\left (\frac {c \tan \left (\frac {1}{2} (e+f x)\right )+d}{\sqrt {c^2-d^2}}\right )}{d f \sqrt {c^2-d^2}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.09, antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {2735, 2660, 618, 204} \[ \frac {b x}{d}-\frac {2 (b c-a d) \tan ^{-1}\left (\frac {c \tan \left (\frac {1}{2} (e+f x)\right )+d}{\sqrt {c^2-d^2}}\right )}{d f \sqrt {c^2-d^2}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 204
Rule 618
Rule 2660
Rule 2735
Rubi steps
\begin {align*} \int \frac {a+b \sin (e+f x)}{c+d \sin (e+f x)} \, dx &=\frac {b x}{d}-\frac {(b c-a d) \int \frac {1}{c+d \sin (e+f x)} \, dx}{d}\\ &=\frac {b x}{d}-\frac {(2 (b c-a d)) \operatorname {Subst}\left (\int \frac {1}{c+2 d x+c x^2} \, dx,x,\tan \left (\frac {1}{2} (e+f x)\right )\right )}{d f}\\ &=\frac {b x}{d}+\frac {(4 (b c-a d)) \operatorname {Subst}\left (\int \frac {1}{-4 \left (c^2-d^2\right )-x^2} \, dx,x,2 d+2 c \tan \left (\frac {1}{2} (e+f x)\right )\right )}{d f}\\ &=\frac {b x}{d}-\frac {2 (b c-a d) \tan ^{-1}\left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{d \sqrt {c^2-d^2} f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.13, size = 67, normalized size = 1.03 \[ \frac {\frac {(2 a d-2 b c) \tan ^{-1}\left (\frac {c \tan \left (\frac {1}{2} (e+f x)\right )+d}{\sqrt {c^2-d^2}}\right )}{\sqrt {c^2-d^2}}+b (e+f x)}{d f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.47, size = 255, normalized size = 3.92 \[ \left [\frac {2 \, {\left (b c^{2} - b d^{2}\right )} f x + {\left (b c - a d\right )} \sqrt {-c^{2} + d^{2}} \log \left (\frac {{\left (2 \, c^{2} - d^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, c d \sin \left (f x + e\right ) - c^{2} - d^{2} + 2 \, {\left (c \cos \left (f x + e\right ) \sin \left (f x + e\right ) + d \cos \left (f x + e\right )\right )} \sqrt {-c^{2} + d^{2}}}{d^{2} \cos \left (f x + e\right )^{2} - 2 \, c d \sin \left (f x + e\right ) - c^{2} - d^{2}}\right )}{2 \, {\left (c^{2} d - d^{3}\right )} f}, \frac {{\left (b c^{2} - b d^{2}\right )} f x + {\left (b c - a d\right )} \sqrt {c^{2} - d^{2}} \arctan \left (-\frac {c \sin \left (f x + e\right ) + d}{\sqrt {c^{2} - d^{2}} \cos \left (f x + e\right )}\right )}{{\left (c^{2} d - d^{3}\right )} f}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.18, size = 86, normalized size = 1.32 \[ \frac {\frac {{\left (f x + e\right )} b}{d} - \frac {2 \, {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\relax (c) + \arctan \left (\frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + d}{\sqrt {c^{2} - d^{2}}}\right )\right )} {\left (b c - a d\right )}}{\sqrt {c^{2} - d^{2}} d}}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.13, size = 119, normalized size = 1.83 \[ \frac {2 \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right ) a}{f \sqrt {c^{2}-d^{2}}}-\frac {2 \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right ) c b}{f d \sqrt {c^{2}-d^{2}}}+\frac {2 b \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 9.68, size = 342, normalized size = 5.26 \[ \frac {2\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )}{d\,f}+\frac {c\,\left (b\,\ln \left (\frac {d\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+c\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )-\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {d^2-c^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {-\left (c+d\right )\,\left (c-d\right )}-b\,\ln \left (\frac {d\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+c\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )+\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {d^2-c^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {d^2-c^2}\right )-a\,d\,\ln \left (\frac {d\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+c\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )-\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {d^2-c^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {-\left (c+d\right )\,\left (c-d\right )}+a\,d\,\ln \left (\frac {d\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+c\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )+\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {d^2-c^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {d^2-c^2}}{d\,f\,\left (c^2-d^2\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 85.45, size = 537, normalized size = 8.26 \[ \begin {cases} \frac {\tilde {\infty } x \left (a + b \sin {\relax (e )}\right )}{\sin {\relax (e )}} & \text {for}\: c = 0 \wedge d = 0 \wedge f = 0 \\\frac {2 a d \sqrt {d^{2}}}{d^{3} f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} - f \left (d^{2}\right )^{\frac {3}{2}}} + \frac {b d^{2} f x \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{d^{3} f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} - f \left (d^{2}\right )^{\frac {3}{2}}} + \frac {2 b d^{2}}{d^{3} f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} - f \left (d^{2}\right )^{\frac {3}{2}}} - \frac {b d f x \sqrt {d^{2}}}{d^{3} f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} - f \left (d^{2}\right )^{\frac {3}{2}}} & \text {for}\: c = - \sqrt {d^{2}} \\- \frac {2 a d \sqrt {d^{2}}}{d^{3} f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + f \left (d^{2}\right )^{\frac {3}{2}}} + \frac {b d^{2} f x \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{d^{3} f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + f \left (d^{2}\right )^{\frac {3}{2}}} + \frac {2 b d^{2}}{d^{3} f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + f \left (d^{2}\right )^{\frac {3}{2}}} + \frac {b d f x \sqrt {d^{2}}}{d^{3} f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + f \left (d^{2}\right )^{\frac {3}{2}}} & \text {for}\: c = \sqrt {d^{2}} \\\frac {\frac {a \log {\left (\tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} \right )}}{f} + b x}{d} & \text {for}\: c = 0 \\\frac {a x - \frac {b \cos {\left (e + f x \right )}}{f}}{c} & \text {for}\: d = 0 \\\frac {x \left (a + b \sin {\relax (e )}\right )}{c + d \sin {\relax (e )}} & \text {for}\: f = 0 \\\frac {a \log {\left (\tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + \frac {d}{c} - \frac {\sqrt {- c^{2} + d^{2}}}{c} \right )}}{f \sqrt {- c^{2} + d^{2}}} - \frac {a \log {\left (\tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + \frac {d}{c} + \frac {\sqrt {- c^{2} + d^{2}}}{c} \right )}}{f \sqrt {- c^{2} + d^{2}}} - \frac {b c \log {\left (\tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + \frac {d}{c} - \frac {\sqrt {- c^{2} + d^{2}}}{c} \right )}}{d f \sqrt {- c^{2} + d^{2}}} + \frac {b c \log {\left (\tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + \frac {d}{c} + \frac {\sqrt {- c^{2} + d^{2}}}{c} \right )}}{d f \sqrt {- c^{2} + d^{2}}} + \frac {b x}{d} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________